<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<!--<head>-->
<!--	<meta charset="utf-8">-->
<!--	<title>Your Page Title</title>-->
<!--	<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>-->
<!--	&lt;!&ndash; 引入Element UI &ndash;&gt;-->
<!--	<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">-->
<!--	<script src="https://unpkg.com/element-ui/lib/index.js"></script>-->
<!--	<th:block th:include="include :: header"></th:block>-->
<!--</head>-->
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-proLine-add"  autocomplete="off">
			<div class="form-group">	
				<label class="col-sm-3 control-label">生产线编码：</label>
				<div class="col-sm-8">
					<input id="lineCode" name="lineCode" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">生产线名称：</label>
				<div class="col-sm-8">
					<input id="lineName" name="lineName" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">计划投产数量：</label>
				<div class="col-sm-8">
					<input id="planNum" name="planNum" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">运行状态  --字典：</label>
<!--				<div class="col-sm-8">-->
<!--					<input id="runState" name="runState" class="form-control" type="text">-->
<!--				</div>-->
				<div class="col-sm-8">
					<div class="radio-box" th:each="dict : ${@dict.getType('run_state')}">
						<input type="radio" th:id="${dict.dictCode}" name="runState" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
					</div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<input id="remark" name="remark" class="form-control" type="text">
				</div>
			</div>
<!--			<div class="form-group">	-->
<!--				<label class="col-sm-3 control-label">0:正常,1:删除：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<input id="delFlag" name="delFlag" class="form-control" type="text">-->
<!--				</div>-->
<!--			</div>-->
<!--			<div class="form-group">	-->
<!--				<label class="col-sm-3 control-label">创建者：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<input id="createBy" name="createBy" class="form-control" type="text">-->
<!--				</div>-->
<!--			</div>-->
<!--			<div class="form-group">	-->
<!--				<label class="col-sm-3 control-label">创建时间：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<input id="createTime" name="createTime" class="form-control" type="text">-->
<!--				</div>-->
<!--			</div>-->
<!--			<div class="form-group">	-->
<!--				<label class="col-sm-3 control-label">更新者：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<input id="updateBy" name="updateBy" class="form-control" type="text">-->
<!--				</div>-->
<!--			</div>-->
<!--			<div class="form-group">	-->
<!--				<label class="col-sm-3 control-label">更新时间：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<input id="updateTime" name="updateTime" class="form-control" type="text">-->
<!--				</div>-->
<!--			</div>-->
			<div class="form-group">
				<label class="col-sm-3 control-label">计数器ID：</label>
				<div class="col-sm-8">
					<input id="counterCode" name="counterCode" class="form-control" type="text">
				</div>
			</div>
<!--			<div class="form-group">-->
<!--				<label class="col-sm-3 control-label">计数器ID：</label>-->
<!--				<div class="col-sm-8">-->
<!--					<el-form-item label="计数器ID" prop="counterCode">-->
<!--						<el-select v-model="form.counterCode" placeholder="请选择计数器ID" clearable>-->
<!--							<el-option-->
<!--									v-for="item in counterList"-->
<!--									:key="item.counterCode"-->
<!--									:value="item.counterCode"-->
<!--									:label="item.counterCode"-->
<!--							/>-->
<!--						</el-select>-->
<!--					</el-form-item>-->
<!--				</div>-->
<!--			</div>-->

		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "project/proLine"
		$("#form-proLine-add").validate({
			// rules:{
			// 	xxxx:{
			// 		required:true,
			// 	},
			// }
			rules: {
				lineCode: {
					required: true,
				},
				lineName: {
					required: true,
				},
				planNum: {
					required: true,
				},
				// counterCode: {
				// 	required: true,
				// },
			},
			messages: {
				lineCode: {
					required: "请输入生产线编码",
				},
				lineName: {
					required: "请输入生产线名称",
				},
				planNum: {
					required: "请输入计划投产数量",
				},
				// counterCode: {
				// 	required: "请输入计数器ID",
				// },
			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/add", $('#form-proLine-add').serialize());
	        }
	    }

		// // 初始化Vue实例，用于计数器ID下拉框数据绑定
		// new Vue({
		// 	el: '#form-proLine-add',
		// 	data: {
		// 		form: {
		// 			factoryId: ''
		// 		},
		// 		counterList: []
		// 	},
		// 	created() {
		// 		this.getCounterList();
		// 	},
		// 	methods: {
		// 		getCounterList() {
		// 			listCounter().then(response => {
		// 				this.counterList = response.rows;
		// 			});
		// 		}
		// 	}
		// });
	</script>
</body>
</html>
